/*
package com.ieslab.powergrid.demosvr.controller;

import com.ieslab.powergrid.demosvr.entity.Person;
import com.ieslab.powergrid.demosvr.service.KafkaTestService;
import com.ieslab.powergrid.demosvr.service.TestService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/api")
@Api(tags="RequestParam用法测试接口类")
public class TestController {
    @Autowired
    TestService testService;
    @Autowired
    KafkaTestService kafkaTestService;
    */
/**
     * 测试自定义监听器入口方法
     * @return 当前人数信息
     *//*

    @GetMapping("/testKafka")
    @ResponseBody
    public String testKafka(String name) {
        kafkaTestService.sendMessage("testDemo",name);
        return name;
    }




    */
/**
     * 测试自定义监听器入口方法
     * @return 当前人数信息
     *//*

    @GetMapping("/testEvent")
    @ResponseBody
    public Person testEvent() {
        return testService.getPerson();
    }


    */
/**
     * 获取当前在线人数
     * @param request
     * @return 当前人数信息
     *//*

    @GetMapping("/total")
    @ResponseBody
    public String getTotalUser(HttpServletRequest request) {
        Integer count = (Integer) request.getSession().getServletContext().getAttribute("count");
        return "当前在线人数：" + count;
    }

    */
/**
     * 接收普通请求参数
     * http://localhost:8080/api/test1?name=liu
     * url参数中的name必须要和@RequestParam("name")一致，
     * 因为请求参数绑定到你控制器的方法参数，所以方法参数可以自定义
     *//*

    @RequestMapping("/test1")
    @ResponseBody
    @ApiOperation(value="测试接口1",notes="url参数中的name必须要和@RequestParam(\"name\")一致，" +
            "因为请求参数绑定到你控制器的方法参数，所以方法参数可以自定义")
    public String test1(@RequestParam("name")String name1){
        System.out.println(name1);
        return name1;
    }

    */
/**
     * 接收普通请求参数
     * http://localhost:8080/api/test2?name=lin
     * url参数中的name必须要和@RequestParam("name")一致
     * url中没有name参数不会报错、有就显示出来
     *//*

    @RequestMapping("/test2")
    @ResponseBody
    public String test2(@RequestParam(value="name",required=false)String name2){
        System.out.println(name2);
        return name2;
    }

    */
/**
     * 接收普通请求参数
     * http://localhost:8080/api/test3?name=zhang 显示为zhang
     * http://localhost:8080/api/test3?name 显示为hello,此时设置了默认值
     *//*

    @RequestMapping("/test3")
    @ResponseBody
    public String test3(@RequestParam(value="name",required=true,defaultValue="hello")String name3){
        System.out.println(name3);
        return name3;
    }

    @RequestMapping("/test4")
    @ResponseBody
    @ApiImplicitParams({
        @ApiImplicitParam(name="name",value="姓名",required=true,paramType="form"),
        @ApiImplicitParam(name="password",value="密码",required=true,paramType="form"),
        @ApiImplicitParam(name="mobile",value="手机号",required=true,paramType="form"),
            @ApiImplicitParam(name="age",value="年龄",required=true,paramType="form",dataType="Integer")
    })
    public String test4(String name, String password, String mobile, String age){
        return name;
    }

    @RequestMapping("/test5")
    @ResponseBody
    @ApiOperation(value = "test5测试请求",notes = "多个参数，多种的查询参数类型")
    @ApiResponses({
            @ApiResponse(code=400,message="请求参数没填好"),
            @ApiResponse(code=404,message="请求路径没有或页面跳转路径不对")
    })
    public String test5(String name, String password, String mobile, String age){
        return name;
    }

    @RequestMapping("/test6")
    @ResponseBody
    public Person test6(String name, String password, String mobile, String age){
        return null;
    }
}
*/
